package edu.harding.redzone;

import java.io.Serializable;
import java.util.ArrayList;

import android.content.res.Resources;


public class Play implements Serializable
{
	private static final long serialVersionUID = 1L;
	 
	private final int MAX_PLAYERS = 11;
	
	private int mId;
	private String mType;
	private String mName;
	private ArrayList<Player> mPlayers;

	private boolean mIsSaved;
	
	public boolean Saved()
	{
		return mIsSaved;
	}
	
	public void Id(int value)
	{
		mId = value;
	}
	
	public int Id()
	{
		return mId;
	}
	
	public String Type()
	{
		return mType;
	}
	
	public void Name(String value)
	{
		mName = value;
	}
	
	public String Name()
	{
		return mName;
	}
	
	public ArrayList<Player> Players()
	{
		return mPlayers;
	}

	public Play(String type, String name, Resources res)
	{
		mType = type;
		mName = name;
		mIsSaved = false;
		
		mPlayers = new ArrayList<Player>();
		
		for (int i = 0; i < MAX_PLAYERS ; i++)
		{
			Player player = new Player(res);
			player.Id(i + 1);
			mPlayers.add(player);
		}
			
	}

	public void Type(String value)
	{
		mType = value;
	}

	public void Saved(boolean value)
	{
		mIsSaved = value;
	}
}
